package com.lhf.smallClass.model;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author 尐痞猫
 * @date2021-06-23 17:19
 */
@Data
public class SmallClass {
    private Integer id;
    @NotBlank(message = "编号不能为空")
    private String code;
    @NotBlank(message = "名称不能为空")
    private String name;
    private String remark;
    @NotNull(message = "状态不能为空")
    private Integer status;
    private String createName;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:dd:ss")
    private Date createTime;
    private String updateName;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:dd:ss")
    private Date updateTime;
    private String statusName;
    public void getstatusName(Integer status){
        if(status==0){
            this.statusName = "启用";
        }else{
            this.statusName="禁用";
        }
    }
}
